CREATE OR REPLACE PROCEDURE sst_state(sqState IN NUMBER) as
/**
 * Called by ConnectorService on state changes.
 * @param sqState	1 when ConnectorService was started
 *                0 when ConnectorService is shutting down
 */
sqsState VARCHAR2(50);
sqSstId NUMBER;
  
begin
	if(sqState = 1) then
	  sqsState := 'Interface started';
	else
	  sqsState := 'Interface stopped';
	end if;	
	
	get_sequence('SSTDAT',0,sqSstId);
	insert into SSTDAT (SSTDAT_ID,SSTTYP,SSTSTAT,NUTZDATEN,erst,erstben_id) values (sqSstId,0,1,sqsState,sysdate,0);
end sst_state;
/
